package com.redxiii.safesync.container;

import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.redxiii.safesync.Archive;

public final class ContainerDetail implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private Long syncDate;
	private Set<String> archivesNames = new HashSet<String>();
	private Map<String, Long> archivesDates = new HashMap<String, Long>();
	private Map<String, Long> archivesSize = new HashMap<String, Long>();
	
	public Long getSyncDate() {
		return syncDate;
	}
	public void setSyncDate(Long syncDate) {
		this.syncDate = syncDate;
	}
	public Set<String> getArchivesNames() {
		return archivesNames;
	}
	
	public Long getModifiedDate(String name) {
		return archivesDates.get(name);
	}
	
	public Long getModifiedSize(String name) {
		return archivesDates.get(name);
	}
	
	public void update(Archive archive) {
		archivesNames.add(archive.getAbsoluteName());
		archivesDates.put(archive.getAbsoluteName(), archive.getModifiedDate());
		archivesSize.put(archive.getAbsoluteName(), archive.getSize());
	}
	
	public void remove(Archive archive) {
		archivesNames.remove(archive.getAbsoluteName());
		archivesDates.remove(archive.getAbsoluteName());
		archivesSize.remove(archive.getAbsoluteName());
	}
}
